package com.tanhua.manage.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tanhua.manage.domain.AnalysisByDay;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

public interface AnalysisByDayMapper extends BaseMapper<AnalysisByDay> {


    @Select("SELECT SUM(num_active) FROM tb_analysis_by_day WHERE record_date BETWEEN  #{begin} AND #{end}")
    Long findNumActiveByDate(@Param("begin") String begin,@Param("end") Date nowDate);

    /**
     *根据时间查询数据
     */

    @Select("SELECT * FROM tb_analysis_by_day WHERE record_date BETWEEN #{begin} AND #{end}")
    List<AnalysisByDay> findActiveByDate(@Param("begin") String  begin, @Param("end") String end);


}
